﻿@*@model HRMS_Model.JobSkill
*@@{
    ViewBag.Title = "JobSkills";
}
 <div style="">
    <table id="jqgJobSkills" cellpadding="0" cellspacing="0">
    </table>
    <div id="jqgpJobSkills" style="text-align: center;">
    </div>
</div>
@section JavaScript{
    <script type="text/javascript">
        $(document).ready(function () {
            $('#jqgJobSkills').jqGrid({
                //url from which data should get
                url: '@Url.Action("JobSkills")',
                //type of data
                datatype: 'json',
                //url access method type
                mtype: 'POST',
                //columns names
                colNames: ['JobSkillId', 'JobId', 'SkillId'],
                //columns model
                colModel: [
                     { name: 'JobSkillId', index: 'JobSkillId', align: 'left', editable: false, width: 80 },
                    { name: 'JobId', index: 'JobId', align: 'left', editable: true, edittype: 'text', width: 100, editoptions: { maxlength: 40 }, editrules: { required: true, edithidden: true }, formoptions: { rowpos: 1, colpos: 1} },
                    { name: 'SkillId', index: 'SkillId', align: 'left', editable: true, edittype: 'text', width: 100, editoptions: { maxlength: 40 }, editrules: { required: true, edithidden: true }, formoptions: { rowpos: 1, colpos: 2} },
                ],
                //pager for grid
                pager: $('#jqgpJobSkills'),
                //number of rows per page
                rowNum: 5,
                //initial sorting column
                sortname: 'JobSkillId',
                //initial sorting direction
                sortorder: 'asc',
                //we want to display total record count
                viewrecords: true,
                //grid height
                height: '100%'
            });
            $('#jqgJobSkills').jqGrid('navGrid', '#jqgpJobSkills',
                { add: true, del: true, edit: true, search: false },
                { width: 'auto', url: '@Url.Action("UpdateJobSkill")' },
                { width: 'auto', url: '@Url.Action("InsertJobSkill")' },
                { width: 'auto', url: '@Url.Action("DeleteJobSkill")' });
        });
    </script>
}
